A22 - Sugoroku
提出
code: python
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
# dpij := i 回目に j に止まった時の最大値 dp = [None * 2 for _ in range(n+1)] # ゴールから逆算
解答
code: python
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(1, n):
dp[ai-1] = max(dp[ai-1], dpi + 100) dp[bi-1] = max(dp[bi-1], dpi + 150)